package com.cskaoyan.controller;

import com.cskaoyan.bean.BaseData;
import com.cskaoyan.bean.BaseParam;
import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.service.UserService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author stone
 * @date 2021/11/29 15:11
 */
@RestController
public class UserController {

    @Autowired
    UserService userService;

    ///admin/user/list?page=1&limit=20&username=user&mobile=110&sort=add_time&order=desc
    //map.put("/admin/user/list","perms[admin:user:list]")
    @RequiresPermissions("admin:user:list")
    @RequestMapping("admin/user/list")
    //public Object list(Integer page,Integer limit,String username,String mobile,String sort,String order) {
    public BaseRespVo list(String username, String mobile, BaseParam param) {
        BaseData data = userService.list(username, mobile, param);
        return BaseRespVo.ok(data);
    }
}
